package customValidate

import (
	"github.com/go-playground/validator/v10"
	"regexp"
)

var Mobile validator.Func = func(fl validator.FieldLevel) bool {
	val, ok := fl.Field().Interface().(string)
	if !ok {
		return false
	}
	reg := regexp.MustCompile(`^1[3-9]\d{9}`)
	return reg.MatchString(val)
}
